import axios from "axios";
import Cookies from 'js-cookie'
import store from '@/store'

let settoken = () => {
  let options = {
    from: 'bigscreen',
    password:
      "H4pMLhaAnOVoZDhhiEL5+yhIYH2Zd9q+OUA9vLLG7K3aAvrjjg55A9BWWg0OpeOhEdShRWhwR6QyCQiNFEJ85qnVvckT9WSYxnpZ/68C+OV9FOIstJLmghLnGHkHiUBuN++dwEeYGz7ps0cjuCylYwN2n2T8Fl0HyeP6LewNcCy9IK+O+N/rT5hvQuBRYt+HFAbXNeNBjjN5cTAEmiatBPZDpJncOrTNs5XWFgApPCjiVX7hqyA9TFe9sbu2XZ4R/Qt/wrx4Dcfa7PKn+KZP9dXcN1KXmGOhoLqxUaYHj+XgH7LxQiRz2epSCBbactJCf7nrls9iYwPDIErPPfR9wA==",
    projectName: store.state.daping.type,
    username: "superadmin",
  };
  
  return new Promise((resolve, reject) => {
    axios.post("/auth/login", options).then(res => {
      if (res.status == 200) {
        Cookies.set("dptoken", res.data.token)
      }
      resolve(res)
    })
  })

};

export default settoken;
